<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>银行管理系统</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/loading-icon.css">
</head>

<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">
            银行管理系统
        </div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->

        <ul class="layui-nav layui-layout-left layui-bg-green">
            <!-- 移动端显示 -->
            <li class="layui-nav layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left" id="leftEnumIcon"></i>
            </li>


            <li class="layui-nav-item">
                <a href="javascript:;"><i class="layui-icon">&#xe665;</i>控制台</a>
            </li>

            <!--      <li class="layui-nav-item">
                      <a href="javascript:;">实验室</a>
                      <dl class="layui-nav-child">
      &lt;!&ndash;                    <dd><a href="" target="main_viewer">a</a></dd>
                          <dd><a href="" target="main_viewer">b</a></dd>
                          <dd><a href="" target="main_viewer">c</a></dd>&ndash;&gt;
                      </dl>
                  </li>-->
        </ul>

        <ul class="layui-nav layui-layout-right layui-bg-cyan">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;">
                    <img src="/static/images/test.png" class="layui-nav-img">
                    <span th:text="${authentication.getName()}"></span>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="/" target="main_viewer">我的信息</a></dd>
                    <dd><a href="/" target="main_viewer">账号设置</a></dd>
                    <dd><a href="/logout">登出</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black" >
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree layui-bg-molv" lay-filter="test" >
                <li class="layui-nav-item">
                    <a href="/client_info" target="main_viewer" class="end-btn" sec:authorize="hasAnyRole('manager','admin')"><i class="layui-icon" style="font-size: 15px; color: #1E9FFF;">&#xe62d;</i>  客户信息一览</a>
                </li>
                <li class="layui-nav-item">
                    <a href="/asset" target="main_viewer" class="end-btn " sec:authorize="hasAnyRole('manager','admin')"><i class="layui-icon" style="font-size: 15px; color: #1E9FFF;">&#xe615;</i>   资产查询</a>
                </li>
                <li class="layui-nav-item ">
                    <a href="/myasset" target="main_viewer" class="end-btn " sec:authorize="hasAnyRole('client','manager','admin')"><i class="layui-icon" style="font-size: 15px; color: #1E9FFF;">&#xe65e;</i>  我的资产</a>
                </li>
                <li class="layui-nav-item">
                    <a href="/card" target="main_viewer" class="end-btn" sec:authorize="hasAnyRole('manager','admin')"><i class="layui-icon" style="font-size: 15px; color: #1E9FFF;">&#xe621;</i>  卡信息一览</a>
                </li>
                <li class="layui-nav-item">
                    <a href="/product" target="main_viewer" class="end-btn" sec:authorize="hasAnyRole('client','manager','admin')"><i class="layui-icon" style="font-size: 15px; color: #1E9FFF;">&#xe63c;</i>  产品信息一览</a>
                </li>
            </ul>
        </div>

    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="sk-three-bounce" id="sk-three-bounce">
            <div class="sk-child sk-bounce1"></div>
            <div class="sk-child sk-bounce2"></div>
            <div class="sk-child sk-bounce3"></div>
        </div>
        <iframe id="main_viewer" name="main_viewer" th:src="@{/hello}" style="height: 100%;width: 100%;border-width: 0"
                onload="LoadOK()">

        </iframe>

    </div>


    <div class="layui-footer">
        <!-- 底部固定区域 -->
        <!--  欢迎访问银行管理系统-->

    </div>
</div>
<script type="text/javascript" src="/static/js/jquery-3.4.1.js"></script>
<script type="text/javascript" src="/static/js/index.js"></script>
<script src="/static/layui/layui.js"></script>
<script>
    //JS
    layui.use(['element', 'layer', 'util'], function(){
        var element = layui.element
            ,layer = layui.layer
            ,util = layui.util
            ,$ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                // layer.msg('展开左侧菜单的操作', {icon: 0});
                var btn = $("#leftEnumIcon");
                if (btn.hasClass('layui-icon-spread-left')) {
                    menuHide(btn);
                    btn.addClass('btn-index');
                } else if (btn.has('layui-icon-shrink-right')) {
                    btn.removeClass('btn-index');
                    menuShow(btn);

                }

                $(window).resize(function () {
                    var width = $(document.body).width();
                    var btn = $("leftEnumIcon");
                    if (width < 1000) {
                        if (btn.hasClass('layui-icon-spread-left')) {
                            menuShow(btn);
                        }
                    } else {
                        if (!btn.hasClass('btn-index')) {
                            if (btn.hasClass('layui-icon-shrink-right')) {
                                menuHide(btn);
                            }
                        }
                    }

                });

                function menuShow(btn) {
                    btn.removeClass('layui-icon-shrink-right').addClass('layui-icon-spread-left');
                    $(".layui-side").animate({width: 'toggle'});
                    $(".zq-logo").animate({width: 'toggle'});
                    $(".layui-body").animate({left: '200px'});
                    $(".layui-footer").animate({left: '200px'});
                }

                function menuHide(btn) {
                    btn.removeClass(' layui-icon-spread-left').addClass('layui-icon-shrink-right');
                    $(".layui-side").animate({width: 'toggle'}); //toggle如果原来div是隐藏的就会把元素显示，如果原来是显示则隐藏
                    $(".zq-logo").animate({width: 'toggle'});
                    $(".layui-body").animate({left: '0px'});
                    $(".layui-footer").animate({left: '0px'});
                }
            }
        });

    });
</script>
</body>
</html>